package com.ruoyi.system.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.AssessType;
import com.ruoyi.system.service.IAssessTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/jixiao/assessType")
public class AssessTypeController extends BaseController {
    @Autowired
    private IAssessTypeService assessTypeService;

    @PostMapping("/insertAssessType")
    public AjaxResult insertAssessType(@RequestBody AssessType assessType){
        return toAjax(assessTypeService.insertAssessType(assessType));
    }
//查
    @GetMapping("/list")
    public TableDataInfo getAssessType(){
//        startPage();
        //返回所有查询结果
        List<AssessType> assessTypes = assessTypeService.selectAssessTypeList();
        return getDataTable(assessTypes);
    }

    //编辑
    @PutMapping("/updateAssessType")
    public AjaxResult updateAssessType(@RequestBody AssessType assessType){
        return toAjax(assessTypeService.updateAssessType(assessType));
    }

    //删除
    @DeleteMapping("/deleteAssessType/{id}")
    public AjaxResult deleteAssessType(@PathVariable("id") int id){
        return toAjax(assessTypeService.deleteAssessType(id));
    }



}
